﻿@page "/pomain/list"
@using BootstrapBlazorApp.Shared.Models.POMain

<Table TItem="POInfoListModel" 
       IsPagination="true" PageItemsSource="@PageItemsSource"
       ShowToolbar="true" ShowSearch="true" IsMultipleSelect="true" ShowExtendButtons="true"
       ShowSearchText="true" ShowCardView ShowColumnList AllowResizing ShowLoading
       FixedExtendButtonsColumn="true"
       IsFixedHeader="true" ExtendButtonColumnWidth="160"
       Height="600"
       AddModalTitle="增加疫苗需求" EditModalTitle="编辑疫苗需求"
       SearchModel="@SearchModel" ShowEmpty="true" SearchMode="SearchMode.Top"
       OnQueryAsync="@OnQueryAsync" OnResetSearchAsync="@OnResetSearchAsync"
       OnAddAsync="@OnAddAsync" OnSaveAsync="@OnSaveAsync" OnDeleteAsync="@OnDeleteAsync">
    <TableColumns>
        <TableColumn @bind-Field="@context.Code" />
        <TableColumn @bind-Field="@context.CompanyName"  />
        <TableColumn @bind-Field="@context.VaccinationPointName"/>
        <TableColumn @bind-Field="@context.VaccineId" Lookup="@VaccineList" />
        <TableColumn @bind-Field="@context.VaccineName" />
        <TableColumn @bind-Field="@context.Quantity" />
        <TableColumn @bind-Field="@context.DemandDate" />
        <TableColumn @bind-Field="@context.TotalReceiveQty" />
    </TableColumns>
    <TableToolbarTemplate>
      
    </TableToolbarTemplate>
    <SearchTemplate>
        <GroupBox Title="搜索条件">
            <div class="row g-3 form-inline">
                <div class="col-3 col-sm-3">
                    <BootstrapInput @bind-Value="@context.CompanyName" placeholder="请输入厂家名称" maxlength="30" ShowLabel="true" DisplayText="厂家名称" />
                </div>
                <div class="col-3 col-sm-3">
                    <BootstrapInput @bind-Value="@context.VaccineName" placeholder="请输入疫苗信息" maxlength="60" ShowLabel="true" DisplayText="疫苗信息" />
                </div>
            </div>
        </GroupBox>
    </SearchTemplate>
     <RowButtonTemplate>
        <TableCellButton Size="Size.ExtraSmall" Color="Color.Primary" Icon="fa fa-edit" Text="明细" OnClickCallback="@(() => OnRowButtonClick(context))" />
        
    </RowButtonTemplate>
</Table>
